package com.freewater.javabase.demo.datetime;

import java.time.LocalDate;
import java.time.Period;

public class PeriodDemo {
    public static void main(String[] args) {
        LocalDate begin = LocalDate.of(2019,7,19);
        LocalDate end = LocalDate.of(2024,4,24);

        Period period = Period.between(begin,end);
        System.out.println("years：" + period.getYears());
        System.out.println("getMonths：" + period.getMonths());
        System.out.println("getDays：" + period.getDays());
    }
}
